import 'package:flutter/material.dart';

/// 应用主题配置
class AppTheme {
  // 颜色配置（参考 H5 版本的暗黑主题）
  static const Color primaryColor = Color(0xFF4A90E2);
  static const Color primaryLight = Color(0xFF5BA3F5);
  static const Color accentColor = Color(0xFF35FFCD);
  
  static const Color bgDark = Color(0xFF121212);
  static const Color bgCard = Color(0xFF1C1C1E);
  static const Color bgHover = Color(0xFF2C2C2E);
  
  static const Color textPrimary = Color(0xFFFFFFFF);
  static const Color textSecondary = Color(0xFFCCCCCC);
  static const Color textTertiary = Color(0xFF999999);
  
  static const Color borderColor = Color(0xFF3A3A3A);
  static const Color highlightBg = Color(0xFFFFEB3B);
  
  // 圆角
  static const double radiusSm = 4.0;
  static const double radiusMd = 8.0;
  static const double radiusLg = 12.0;
  
  // 渐变色（用于按钮、进度条等）
  static const LinearGradient primaryGradient = LinearGradient(
    colors: [Color(0xFF890CF5), Color(0xFF3055F5), Color(0xFF0089BE), Color(0xFF00B680)],
    stops: [0.0, 0.33, 0.66, 1.0],
  );
  
  static const LinearGradient accentGradient = LinearGradient(
    colors: [Color(0xFF35FFCD), Color(0xFF2DD4B4)],
  );
  
  // 暗黑主题
  static ThemeData get darkTheme {
    return ThemeData(
      brightness: Brightness.dark,
      primaryColor: primaryColor,
      scaffoldBackgroundColor: bgDark,
      
      // AppBar 主题
      appBarTheme: const AppBarTheme(
        backgroundColor: bgCard,
        foregroundColor: textPrimary,
        elevation: 0,
        centerTitle: true,
        titleTextStyle: TextStyle(
          color: textPrimary,
          fontSize: 18,
          fontWeight: FontWeight.w600,
        ),
      ),
      
      // Card 主题
      cardTheme: CardThemeData(
        color: bgCard,
        elevation: 0,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(radiusMd),
        ),
      ),
      
      // Text 主题
      textTheme: const TextTheme(
        displayLarge: TextStyle(color: textPrimary, fontSize: 32, fontWeight: FontWeight.bold),
        displayMedium: TextStyle(color: textPrimary, fontSize: 28, fontWeight: FontWeight.bold),
        displaySmall: TextStyle(color: textPrimary, fontSize: 24, fontWeight: FontWeight.bold),
        headlineMedium: TextStyle(color: textPrimary, fontSize: 20, fontWeight: FontWeight.w600),
        headlineSmall: TextStyle(color: textPrimary, fontSize: 18, fontWeight: FontWeight.w600),
        titleLarge: TextStyle(color: textPrimary, fontSize: 16, fontWeight: FontWeight.w500),
        bodyLarge: TextStyle(color: textPrimary, fontSize: 16),
        bodyMedium: TextStyle(color: textSecondary, fontSize: 14),
        bodySmall: TextStyle(color: textTertiary, fontSize: 12),
      ),
      
      // Icon 主题
      iconTheme: const IconThemeData(
        color: textPrimary,
        size: 24,
      ),
      
      // Bottom Navigation Bar 主题
      bottomNavigationBarTheme: const BottomNavigationBarThemeData(
        backgroundColor: bgCard,
        selectedItemColor: accentColor,
        unselectedItemColor: textTertiary,
        type: BottomNavigationBarType.fixed,
        elevation: 0,
      ),
      
      // Divider 主题
      dividerTheme: const DividerThemeData(
        color: borderColor,
        thickness: 1,
      ),
      
      // Slider 主题
      sliderTheme: SliderThemeData(
        activeTrackColor: primaryColor,
        inactiveTrackColor: borderColor,
        thumbColor: accentColor,
        overlayColor: accentColor.withOpacity(0.2),
        trackHeight: 4,
      ),
      
      colorScheme: const ColorScheme.dark(
        primary: primaryColor,
        secondary: accentColor,
        surface: bgCard,
        onSurface: textPrimary,
      ),
    );
  }
}

